package com.settlement.system.rules;

import com.settlement.system.model.entity.SysAudit;
import com.settlement.system.model.entity.SysAuditRule;

import java.math.BigDecimal;

/**
 * 14b、财务手工平账规则器
 */
public class FinanceManualFlatAccountRuler implements CommonRuler {
    @Override
    public boolean check(SysAudit sysAudit, SysAuditRule auditRule) {
        // 应收账款余额≠0
        // 且应收账款余额=财务调账金额
        return BigDecimal.ZERO.compareTo(sysAudit.getReceiveBillAmount()) != 0 &&
                sysAudit.getReceiveBillAmount().compareTo(sysAudit.getReconciliationAmount()) == 0;
    }
}
